#include<iostream>
using namespace std;
typedef long long LL;
const int N = 55;
int arr[N][N];
int n;
int main()
{
	cin >> n;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			cin >> arr[i][j];
			if (i == 1 || i == n || j == 1 || j == n || i == j || i + j == n + 1) {
				ans += arr[i][j];
			}
		}
	}
	cout << ans << endl;
	return 0;
}